package cn.edu.scau.cmi.xiefuan.client;

import cn.edu.scau.cmi.xiefuan.composite.compliance.Organization;
import cn.edu.scau.cmi.xiefuan.composite.compliance.Person;



public class CompositeComplianceClient {

	public static void main(String[] args) {
		/**
		 * 		   composite1 
		 * 		 	/     \ 
		 * 		leaf1   composite2 
		 * 				 /      \ 
		 * 			  leaf2    leaf3
		 * 
		 * */
		Person leaf1 = new Person("张三");
		Person leaf2 = new Person("李四");
		Person leaf3 = new Person("王五");
		Organization composite1 = new Organization("总部");
		Organization composite2 = new Organization("分部1");

		composite2.add(leaf2);
		composite2.add(leaf3);
		composite1.add(leaf1);
		composite1.add(composite2);

		composite1.doSomething();

	}
}
